package unit3;

import java.math.BigInteger;
import java.util.Scanner;

public class BigIntegerTest {
	public static void main(String[] args) {
		@SuppressWarnings("resource")
		Scanner in=new Scanner(System.in);
		
		System.out.println("How many numbers do you need to draw?");
		int k=in.nextInt();
		
		System.out.println("What is the highest numbers you can draw?");
		int n=in.nextInt();
		
		/*
		 * compute binomial coefficient n*(n-1)*(n-2)*...*(n-k+1)/(1*2*3*4*5*...*k)
		 */
		
		BigInteger lotteryOdds=BigInteger.valueOf(1);
		
		for(int x=1;x<=k;x++){
			lotteryOdds=lotteryOdds.multiply(BigInteger.valueOf((n-x+1)).divide(BigInteger.valueOf(x)));
		}
		System.out.println("You odds are 1 in "+lotteryOdds+".Good Luck!");
	}
}
